package com.forekenow.Demo4.exercise10726;

public class Cat {
    private String name;
    private int legNum;

    public String getName() {
        return name;
    }

    public int getLegNum() {
        return legNum;
    }
    public Cat(String name,int legNum){
        this.name=name;
        this.legNum=legNum;
    }
    public void shout(){
        System.out.println("喵喵喵");
    }

    public static void main(String[] args) {
        Cat cat = new Cat("jack",4);
        System.out.print(cat.getName()+cat.legNum);
        cat.shout();
        Duck duck = new Duck("唐小鸭",2);
        System.out.print(duck.getName()+duck.getLegNum());
        duck.shout();


    }
}
